package com.kabigon.jvm.stack;

/**
 * 演示栈内存溢出 java.lang.StackOverflowError
 * -Xss256k
 * @author xu.biao
 * @version v1.0
 * @Package com.kabigon.jvm.stack
 * @data 2023/2/18 15:34
 */
public class Demo1_2 {
    private static int count;

    public static void main(String[] args) {
        try {
            method();
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println(count);
        }
    }

    private static void method() {
        count++;
        method();
    }

}
